//package com.dcits.filter.xss;
//
//import com.dcits.secrity.SecurityProperties;
//import org.springframework.boot.web.servlet.FilterRegistrationBean;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.Ordered;
//
//import javax.annotation.Resource;
//
//@Configuration
//public class FilterConfiguration {
//    @Resource
//    private SecurityProperties securityProperties;
//
//    @Bean
//    public FilterRegistrationBean<XSSFilter> xssFilter() {
//        FilterRegistrationBean<XSSFilter> registration = new FilterRegistrationBean<>();
//        registration.setFilter(new XSSFilter(securityProperties));
//        registration.addUrlPatterns("/*");
//        registration.setName("XSS Filter");
//        registration.setOrder(Ordered.HIGHEST_PRECEDENCE); // 最高优先级
//        return registration;
//    }
//}